Address assignment method for at least one bus device that has recently been connected to a bus system

ABSTRACT

A bus device ( 2′ ) that has recently been connected to a bus system is first addressable at a pre-set address ( 126 ). A bus master ( 1 ) transmits a new address (x) and an identification (k) to the bus device ( 2′ ). The bus device ( 2′ ) compares the transmitted identification (k) with an identification (k′) that has been stored in the bus device ( 2′ ) and assumes the transmitted new address (x), if the transmitted identification (k) corresponds with the identification (k′) that has been stored in the bus device ( 2′ ). The bus device ( 2′ ) is then addressable at the new address (x).

[0001] The present invention relates to an address assignment method for at least one bus device that has been newly connected to a bus system, which is first addressable at a pre-set address, whereby a bus master transmits a new address to the bus device, the bus device assumes the transmitted new address, and the bus device is then addressable at the new address.

[0002] Address assignment methods for precisely one newly connected bus device are known, for example, in the PROFIBUS under the name “node baptism”. Here, the address is assigned by means of the Service Access Point (SAP) 55 via an acknowledged SRD service.

[0003] In the state-of-the-art method, each bus device newly connected to the bus system which is addressable at the pre-set address (by definition address 126) is addressed. Only one bus device that is addressable at this address may therefore be available at one time, since, in the state-of-the-art method, each addressed bus device newly connected to the bus system assumes the transmitted address, regardless of whether the transmitted address is or is not still being assumed by a further bus device.

[0004] The object of the present invention is to produce an address assignment method in which correct address assigment, appropriate to the project concerned, is always possible, even if a plurality of bus devices have been newly simultaneously connected to the bus system.

[0005] The object is achieved in that an identification is transmitted to the bus device in addition to the new address, the bus device compares the transmitted identification with an identification stored in the bus device and assumes the transmitted new address only if the transmitted identification corresponds to the identification stored in the bus device.

[0006] Only the bus device whose identification has been transmitted then assumes the transmitted new address, regardless of the number of bus devices newly connected to the bus system.

[0007] The transmission of the identification and the new address is not acknowledged by the bus device newly connected to the bus system, since no interference can then occur on the bus system, even in the case of a plurality of bus devices simultaneously or virtually simultaneously connected to the bus system.

[0008] If the bus master, immediately before transferring the identification and the new address, checks whether a different bus device is already addressable at the new address, accidental multiple address assignment cannot occur.

[0009] If the new address which is to be assigned has already been assigned, the “node baptism” can then either be omitted or carried out with a different address. An error message can also be output.

[0010] If the bus master, immediately after transferring the identification and the new address, checks whether the bus device newly connected to the bus system is addressable at the new address, and, if the bus device newly connected to the bus system is not addressable, retransmits the identification and the new address, the address assignment is repeated until the bus device newly connected to the bus system has assumed its new address. It is thus ensured that the address assignment is actually carried out. The methods for checking the address assignment are known per se.

[0011] If the bus master detects that a bus device is no longer addressable, it resumes the address assignment method.

[0012] If the new address is retentively stored by the bus device, the newly assigned address is retained even in the event of a power failure. It does not have to be re-assigned. The new address can be stored, for example, in a buffered RAM or in an EEPROM.

[0013] A typical application of the address assignment method according to the invention can be found in a field bus, e.g. the PROFIBUS.

[0014] Further advantages and details are set out in the following description of an embodiment, including diagrammatic illustrations, in which:

[0015]FIG. 1 shows a bus system,

[0016]FIG. 2 shows a bus master,

[0017]FIG. 3 shows a bus device,

[0018]FIG. 4 shows a flow chart for the bus master, and

[0019]FIG. 5 shows a flow chart for the bus device.

[0020] According to FIG. 1, a bus system has a bus master 1 and a plurality, according to FIG. 1 e.g. three, of passive bus devices 2 connected to the bus system. The bus system is designed as a serial bus system of the type generally used in field buses, e.g. the PROFIBUS. A technical installation 3 is controlled and monitored by means of the bus system. For communication between the bus master 1 and the bus devices 2, the bus master issues addresses and, if necessary, a command and/or data to the bus devices 2. Using the assigned address, these bus devices check whether they are addressed. They respond only if they are addressed.

[0021] According to FIG. 2, the bus master 1 has a microprocessor 4. The microprocessor 4 processes a computer program product which is stored e.g. in an EEPROM 5. Data administered by the microprocessor 4 are stored in a data memory 6 and the addresses of the individual bus devices 2 are stored in a further EEPROM 7.

[0022] According to FIG. 3, the bus devices 2 have a microprocessor 8. The latter similarly runs a computer program product which is stored in an EEPROM 9. In a data memory 10, the bus device 2 buffers data between the bus master 1 and the technical installation 3. An identification k′ and an address adr′ are further stored in the EEPROM 9.

[0023] The identification k′ must be unique, at least within the bus system. It is preferably already stored by the manufacturer of the bus device 2 in the EEPROM 9. Here, it can be ensured by suitable measures that this identification k′ is only assigned once worldwide.

[0024] The address adr′ is first set to a previously known value, in the PROFIBUS e.g. to the value 126. The bus device 2 can be addressed at this address adr′ until the address adr′ is changed by the bus master 1 to a different value, e.g. between 1 and 125.

[0025] The above statements on the bus devices 2 also apply to further bus devices 2′ which are to be newly connected to the bus system. The only difference between the bus devices 2 and the bus devices 2′ is that the former are already operated on the bus at addresses adr′ between 1 and 125, whereas the newly connected bus devices 2′ still have their initial address 126.

[0026] In order to enable correct operation of the bus devices 2′ newly connected to the bus system, the initial address 126 must first be changed. The procedure for doing this is as follows:

[0027] According to FIG. 4, the bus master 1 first requests, in a step 11, an address x which is to be newly assigned within the bus system. If the bus master 1, in a step 12, detects a response with this address x, it quits the address assignment program according to a step 13. The bus master 1 therefore first checks whether a bus device 2 is already addressable at the address x which is to be newly assigned.

[0028] If the bus master 1 detects no response, it transmits an identification k and the address x which is to be newly assigned at the address 126. Immediately thereafter, it again checks whether a bus device 2, 2′ responds at the address x. If the bus master 1, in a step 16, detects a response, the bus device 2′ newly connected to the bus system has assumed the address x, i.e. it is now addressable at this address x. In this case, the address assignment is ended according to a step 17. Otherwise, the bus master 1 repeats steps 14 to 16.

[0029] The identification k can be defined for the bus master 1—see FIG. 2—for example via a keyboard 18 or any other input means. In addition, it should further be mentioned that the repetition of steps 14 to 16 can be restricted to a predefined number, e.g. three or four passes.

[0030] Before assuming the address x which is to be assigned, the bus device 2′, in a step 19, has its address adr′ initially set to the value 126. In a step 20, the bus device 2′ then receives an address adr via the bus system, at which the bus master 1 addresses the bus devices 2, 2′. In a step 21, the bus device 2′ checks whether the received address adr corresponds to its own address adr′. If not, the bus device 2′ concerned is not addressed and therefore ends the further reception of information according to a step 22.

[0031] If the addresses adr, adr′ correspond, the bus device 2′, in a step 23, checks whether its address adr′ is still set to the value 126. If not, a new address has already been assigned to this bus device 2′. In this case, it processes a different response according to a step 24. Otherwise, the bus device 2′, in a step 25, receives the transmitted identification k and the address x which is to be assigned.

[0032] The bus device 2′ then checks, in a step 26, whether the transmitted identification k corresponds to the identification k′ stored in it. If not, it is not addressed and ends the address change routine according to a step 27. Otherwise, in a step 28, it assumes the transmitted address x as its new address adr′. The transmitted address x is stored by the bus device 2′ in the EEPROM 9, i.e. retentively. In the event of further calling, this bus device 2′ is then no longer addressable at the address 126, but at the address x.

[0033] The address k may also be stored non-retentively by the bus device 2′. In this case, the predefined address, e.g. 126, can always be assumed initially, e.g. on start-up.

[0034] In principle, a separate message can be used for each identification address pair. However, a plurality of pairs can also be combined if necessary into one message. In the case of a large number of bus devices 2′ newly connected to the bus system, a plurality of messages can also be transmitted, in each case with a plurality of pairs.

[0035] The decisive advantage of the present invention is that the bus device 2′ does not acknowledge the transmission of the identification k and the new address x. As a result, a plurality of bus devices 2′ can be newly connected to the bus system in one pass. 

1. An address assignment method for at least one bus device (2′) that has been newly connected to a bus system, whereby the bus device (2′) is first addressable at a pre-set address (126), whereby a bus master (1) transmits a new address (x) and an identification (k) to the bus device (2′), whereby the bus device (2′) compares the transmitted identification (k) with an identification (k′) stored in the bus device (2′), and whereby the bus device (2′) assumes the transmitted new address (x) if the transmitted identification (k) corresponds to the identification (k′) stored in the bus device (2′), whereby the bus device (2′) is then addressable at the new address (x).
 2. An address assignment method as claimed in claim 1, characterized in that the bus device (2′) does not acknowledge the transmission of the identification (k) and the new address (x).
 3. An address assignment method as claimed in claim 1 or 2, characterized in that the bus master (1), before transferring the identification (k) and the new address (x), checks whether a different bus device (2′) is already addressable at the new address (x).
 4. An address assignment method as claimed in claim 1, 2 or 3, characterized in that the bus master (1), immediately after transferring the identification (k) and the new address (x), checks whether the bus device (2′) newly connected to the bus system is addressable at the new address (x), and, if the bus device (2′) newly connected to the bus system is not addressable, the bus master (1) retransmits the identification (k) and the new address (x).
 5. An address assignment method as claimed in one of the above claims, characterized in that the new address (x) is retentively stored by the bus device (2′).
 6. An address assignment as claimed in one of the above claims, characterized in that it is used in a field bus, e.g. the PROFIBUS.
 7. A computer program product for a bus master (1) to carry out an address assignment method as claimed in one of the above claims.
 8. A bus master programmed with a computer program product as claimed in claim
 7. 9. A computer program product for a bus device (2′) to carry out an address assignment method as claimed in one of claims 1 to
 6. 10. A bus device to carry out an address assignment method as claimed in one of claims 1 to
 6. 11. A bus device as claimed in claim 10, characterized in that it is programmed with a computer program product as claimed in claim
 9. 